Clear list of attached windows when disposing a widget
authorMatthias Clasen <mclasen@redhat.com>
Thu, 2 May 2013 12:02:40 +0000 (08:02 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Thu, 2 May 2013 12:02:40 +0000 (08:02 -0400)
We were silently relying on everybody to detach their windows,
and would leak memory otherwise.

gtk/gtkwidget.c

index b3f54c6ce8824184219d189b2fbb619408a40a43..21369287384326f1da8fd7f944c40534f0207dc8 100644 (file)
@@ -11052,6 +11052,9 @@ gtk_widget_dispose (GObject *object)
 
   g_clear_object (&priv->muxer);
 
+  g_list_free (priv->attached_windows);
+  priv->attached_windows = NULL;
+
   G_OBJECT_CLASS (gtk_widget_parent_class)->dispose (object);
 }